// Problem: H - Peer Review
// Idea: Do what they say - Ad Hoc.
// Language: C++
// Author: Ivan Vladimirov Ivanov (ivan.vladimirov.ivanov@gmail.com)

#include <cstdio>
#include <string>
#include <vector>
#include <set>

using namespace std;

#define MAX 1005

int  input(void);
void solve(void);

int is_valid(int id);

int n, m;
string I[MAX];
vector <int> R[MAX];

int main(void)
{
  while(input()) solve();

  return 0;
}

int input(void)
{
  scanf("%d %d", &m, &n);
  if(n == 0 && m == 0) return 0;
  for(int i = 0; i < n; i++) {
    char buf[32];
    scanf(" %s", buf);
    I[i] = buf;
    R[i].clear();
    for(int j = 0; j < m; j++) {
      int x;
      scanf("%d", &x);
      R[i].push_back(x);
    }
  }
  return 1;
}

void solve(void)
{
  int cnt = 0;
  for(int i = 0; i < n; i++) {
    cnt += is_valid(i) ? 0 : 1;
  }

  if(cnt == 0) printf("NO PROBLEMS FOUND\n");
  else printf("%d PROBLEMS FOUND\n", cnt);
}

int is_valid(int id)
{
  vector <int> r;
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < m; j++) {
      if(R[i][j] == id + 1) {
        r.push_back(i);
        if(I[i] == I[id]) return 0;
      }
    }
  }

  set <int> t(r.begin(), r.end());
  return r.size() == t.size() && r.size() == m;
}

